package com.voilet.interview.rx.operator.filter;

import android.util.Log;

import com.voilet.interview.rx.operator.absOperator;

import io.reactivex.Observable;
import io.reactivex.functions.Consumer;

/**
 * Created by kan212 on 2019/4/10.
 */

public class ofType implements absOperator {

    @Override
    public void test() {
        Observable.just(1, "Carson", 3, "Ho", 5)
                .ofType(Integer.class) // 筛选出 整型数据
                .subscribe(new Consumer<Integer>() {
                    @Override
                    public void accept( Integer integer) throws Exception {
                        Log.d(TAG,"获取到的整型事件元素是： "+ integer);
                    }
                });
    }

    @Override
    public void test2() {

    }
}
